import 'reflect-metadata';
import React, { Context } from 'react';
import ReactDOM from 'react-dom/client';
import App from './App.tsx';
import './index.css';
import { RecoilRoot } from 'recoil';
import { i18n, I18nContext } from './utils/i18n';
import { FeatureConfigContext } from './feature-antd';

ReactDOM.createRoot(document.getElementById('root')!).render(
  <React.StrictMode>
    <RecoilRoot>
      <FeatureConfigContext.Provider
        value={{
          contexts: {
            i18n: I18nContext as Context<unknown>,
          },
        }}
      >
        <I18nContext.Provider value={i18n}>
          <App />
        </I18nContext.Provider>
      </FeatureConfigContext.Provider>
    </RecoilRoot>
  </React.StrictMode>,
);
